<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>酒店信息系统</title>
    {include file="public/head"}
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/style.css">
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/css/page.css" />
    <!--<script src="__PUBLIC__/js/jquery-1.3.2.min.js" type="text/javascript"></script>-->
<script language="javascript" type="text/javascript" src="__PUBLIC__/js/WdatePicker.js"></script>

    <!--<script src="__PUBLIC__/js/jquery-1.8.3.min.js" type="text/javascript"></script>-->
    <script src="__PUBLIC__/js/highcharts.js" type="text/javascript"></script>

    <script>
        var titleNamestr='{$titleNamestr}';
        var categoriesTotal={$categoriesTotal};
        var dataTotal={$dataTotal};
        var dataTotalper={$dataTotalper};

        $(function () {
            $('#checkinCount').highcharts({
                chart: {
                    type: 'column'
                },
                title: {
                    text:titleNamestr+'入住统计'
                },
                xAxis: {
                    categories: categoriesTotal
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: '入住数（间）'
                    },
                    stackLabels: {
                        enabled: true,
                        style: {
                            fontWeight: 'bold',
                            color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
                        }
                    }
                },
                legend: {
                    align: 'right',
                    x: -70,
                    verticalAlign: 'top',
                    y: 20,
                    floating: true,
                    backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
                    borderColor: '#CCC',
                    borderWidth: 1,
                    shadow: false
                },
                tooltip: {
                    formatter: function() {
                        return '<b>'+ this.x +'</b><br/>'+
                                this.series.name +': '+ this.y +'<br/>'+
                                'Total: '+ this.point.stackTotal;
                    }
                },
                plotOptions: {
                    column: {
                        stacking: 'normal',
                        dataLabels: {
                            enabled: true,
                            color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
                        }
                    }
                },
                series: dataTotal
            });
        });

        $(function () {
            $('#container').highcharts({
                title: {
                    text:titleNamestr+ '入住率统计',
                    x: -20 //center
                },
                xAxis: {
                    categories:categoriesTotal
                },
                yAxis: {
                    title: {
                        text:  '入住率 (%)'
                    },
                    plotLines: [{
                        value: 0,
                        width: 1,
                        color: '#808080'
                    }]
                },
                tooltip: {
                    valueSuffix: '%'
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'middle',
                    borderWidth: 0
                },
                series: dataTotalper
            });
        });


    </script>

    <script language='javascript'>

    var isShow = false;
    function show(){
        if(isShow){
            document.getElementById("time").style.display="none";
            isShow = false;
        }else{
            document.getElementById("time").style.display="block";
            isShow = true;
        }
    }

    function subsouGroup(){
        var groupname = $("#groupname").val();
        var stime = $("#stime").val();
        var etime = $("#etime").val();
        window.location.href='__APP__/admin/subsouArea?groupname='+groupname+'&stime='+stime+'&etime='+etime;
    }

</script>
</head>
<body>


</div>
<div class="content_2 clear">
{include file="admin/left"}

 <div class="content_3 left">
  <div class="content_3_wz"><img src="__PUBLIC__/images/dajt.png">系统管理 > 数据统计</div>
  <div class="content_3_fdj"><img src="__PUBLIC__/images/fdj.jpg"></div>
  <div class="content_3_xian"></div>
  <div class="content_3_ss clear">

      <ul>
          <li><span class="ctt_wd left">按区域：</span>
              <select id='groupname' >
                  <option value="0">选择区域</option>
                  <option value="all">全部区域</option>
                  <?
                 if($groupArr){
                 foreach($groupArr as $var){
                    ?>
                  <option value="{$var['id']}">{$var['areaname']}</option>
                  <?
                 }
                 }
              ?>
              </select>

          </li>

          <li class="ss_cx"><a href="#" onClick="subsouGroup()">搜索</a></li>
      </ul>

      <div class="content_1234" style=" float:left;padding-left:10px; width:700px; ">
          <div class="tjxx_an"  >
              <div id="time" style="DISPLAY:none;" >
                  <table width="100%" border="0" align="center"  cellpadding="0" bgcolor="#EEF7FF" style="text-align:center; border:1px solid #80BFFF;  margin-bottom:10px;">
                      <tbody>
                      <tr  style="border:none;">
                          <td height="50" align="right">
                              <div class="qishishijian" style=" margin-top:0;">
                                  <p class="qssj_wz">起始时间:</p>
                                  <input name="text22" type="text" class="ss_k left" value="<?php echo $starttime;?>" onClick="WdatePicker()"  id="stime"/>
                                  <p class="qssj_wzz">结束时间:</p>
                                  <input name="text22" type="text" class="ss_k left" value="{$endtime}" onClick="WdatePicker()"  id="etime"/>
                                  <div class="blank"></div>
                              </div>
                          </td>
                      </tr>
                      </tbody>
                  </table>
              </div>
              <ul style="margin-bottom:2px;">
                  <li>
                      <input name="submit" type="submit" value="按时间查看" class="btn_04"  onclick="show()"/>
                  </li>
              </ul>
          </div>
          <div class="blank"></div>
      </div>

</div>
     <?
     if($countArr){
     ?>
     <div style="width:700px; margin-left:18px; margin-top:100px;text-align:center;font-size: 22px;" > 酒店：{$countArr[0]['hotelCount']} 家  &nbsp; &nbsp;  终端：{$countArr[0]['clientTotal']} 间   &nbsp; &nbsp;  投影 ：{$countArr[0]['clientXsNoTotal']}
         &nbsp; &nbsp;   盒子：{$countArr[0]['clientNoPcTotal']}   &nbsp; &nbsp;   电视：{$countArr[0]['clientNoTvTotal']}  &nbsp; &nbsp;     </div>
     <?
     }
     ?>

     <div id="checkinCount" style="min-width:400px;height:400px;margin-top: 40px;margin-left: 30px"></div>
     <div id="container" style="min-width:400px;height:400px;margin-top: 40px;margin-left: 30px"></div>

 </div>
</div>

</body>
</html>

